package com.keeley.mybatisTools.ext;

import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.core.resource.ClasspathResourceLoader;
import org.beetl.core.resource.FileResourceLoader;
import org.beetl.core.resource.StringTemplateResourceLoader;

import java.io.File;
import java.io.IOException;

/**
 * Created by djei on 2015-02-12.
 */
public class TaskRun {
    public static void main(String []args) throws IOException {

        String url ="jdbc:oracle:thin:@222.73.163.46:5200/orcl";

        ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader();
        Configuration cfg = Configuration.defaultConfiguration();
        GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
        Template t = gt.getTemplate("/templates/generatorConfig.txt");

        t.binding("jdbc_url", url);
        System.out.println(t.render());
    }
}
